package org.spring.node2.domain.item.service;

import lombok.extern.slf4j.Slf4j;
import org.spring.node2.domain.item.vo.ItemVO;
import org.springframework.stereotype.Service;

import java.util.Map;
import java.util.concurrent.ConcurrentHashMap;

@Slf4j
@Service
public class ItemService {
    private static Map<Long, ItemVO> itemMap = new ConcurrentHashMap<>();

    static {
        ItemVO item1 = new ItemVO(1L, "阿迪达斯", 200);
        ItemVO item2 = new ItemVO(2L, "乔丹", 300);
        itemMap.put(1L, item1);
        itemMap.put(2L, item2);
    }

    public ItemVO queryItemById(Long itemId) {
        return itemMap.get(itemId);
    }
}
